TESTFILES = tabs.c \
tabsolute.c \
tacos.c \
tacosh.c \
tadd.c \
tlogical_and.c \
tannotatefunction.c \
tappend.c \
tasin.c \
tasinh.c \
tasciiplot.c \
tatan.c \
tatanh.c \
tbashexecute.c \
tbezout.c \
tbinary.c \
tboolean_list_ops.c \
tbuild_end_elliptic_list.c \
tbuild_function_abs.c \
tbuild_function_acos.c \
tbuild_function_acosh.c \
tbuild_function_add.c \
tbuild_function_asin.c \
tbuild_function_asinh.c \
tbuild_function_atan.c \
tbuild_function_atanh.c \
tbuild_function_ceil.c \
tbuild_function_cos.c \
tbuild_function_cosh.c \
tbuild_function_div.c \
tbuild_function_double.c \
tbuild_function_double_double.c \
tbuild_function_doubleextended.c \
tbuild_function_erf.c \
tbuild_function_erfc.c \
tbuild_function_exp.c \
tbuild_function_expm1.c \
tbuild_function_floor.c \
tbuild_function_free_variable.c \
tbuild_function_halfprecision.c \
tbuild_function_libraryconstant.c \
tbuild_function_libraryconstant_with_data.c \
tbuild_function_libraryfunction.c \
tbuild_function_libraryfunction_with_data.c \
tbuild_function_log10.c \
tbuild_function_log1p.c \
tbuild_function_log2.c \
tbuild_function_log.c \
tbuild_function_mul.c \
tbuild_function_nearestint.c \
tbuild_function_neg.c \
tbuild_function_pi.c \
tbuild_function_pow.c \
tbuild_function_procedurefunction.c \
tbuild_function_quad.c \
tbuild_function_sin.c \
tbuild_function_single.c \
tbuild_function_sinh.c \
tbuild_function_sqrt.c \
tbuild_function_sub.c \
tbuild_function_tan.c \
tbuild_function_tanh.c \
tbuild_function_triple_double.c \
tbuild_list.c \
tcanonical.c \
tceil.c \
tcheckinfnorm.c \
tcmp_equal.c \
tcmp_greater.c \
tcmp_greater_equal.c \
tcmp_in.c \
tcmp_less.c \
tcmp_less_equal.c \
tcmp_not_equal.c \
tcmp_objs_structurally.c \
tcoeff.c \
tconcat.c \
tconstant.c \
tconstant_from_double.c \
tconstant_from_int64.c \
tconstant_from_int.c \
tconstant_from_mpq.c \
tconstant_from_mpz.c \
tconstant_from_uint64.c \
tconstant_list_ops.c \
tconstruct_function.c \
tcopy_obj.c \
tcos.c \
tcosh.c \
tcreate_structure.c \
tdecimal.c \
tdecompose_externaldata.c \
tdecompose_externalprocedure.c \
tdecompose_externalprocedure_with_data.c \
tdecompose_function.c \
tdecompose_libraryconstant.c \
tdecompose_libraryconstant_with_data.c \
tdecompose_libraryfunction.c \
tdecompose_libraryfunction_with_data.c \
tdecompose_procedurefunction.c \
tdefault.c \
tdegree.c \
tdenominator.c \
tdiff.c \
tdirtyinfnorm.c \
tdirtyintegral.c \
tdirtysimplify.c \
tdiv.c \
tdouble.c \
tdouble_double.c \
tdouble_double_obj.c \
tdoubleextended.c \
tdoubleextended_obj.c \
tdouble_obj.c \
tdyadic.c \
tend_elliptic_list.c \
terf.c \
terfc.c \
terror.c \
teuclidian_div.c \
teuclidian_mod.c \
tevaluate_function_at_constant_expression.c \
tevaluate_function_at_point.c \
texecute.c \
texecute_procedure.c \
texternaldata.c \
texternalprocedure.c \
texternalprocedure_with_data.c \
texp.c \
texpand.c \
texpm1.c \
tfalse.c \
tfile.c \
tfixed.c \
tfloating.c \
tfloor.c \
tfpminimax.c \
tfree_variable.c \
tgcd.c \
tget_autosimplify.c \
tget_bounds_from_range.c \
tget_canonical.c \
tget_constant_as_double.c \
tget_constant_as_int.c \
tget_constant_as_int64.c \
tget_constant_as_mpq.c \
tget_constant_as_mpz.c \
tget_constant_as_uint64.c \
tget_constant_as_uint64_array.c \
tget_diam.c \
tget_dieonerrormode.c \
tget_display.c \
tget_element_in_list.c \
tget_element_in_list_timecomplexity.c \
tget_free_variable_name.c \
tget_function_arity.c \
tget_head_function.c \
tget_help_text.c \
tget_hopitalrecursions.c \
tget_interval_from_range.c \
tget_list_elements.c \
tget_midpointmode.c \
tget_nth_subfunction.c \
tget_points.c \
tget_prec.c \
tget_rationalmode.c \
tget_roundingwarnings.c \
tget_showmessagenumbers.c \
tget_string.c \
tget_structure_elements.c \
tget_subfunctions.c \
tget_element_in_structure.c \
tget_taylorrecursions.c \
tget_timing.c \
tget_verbosity.c \
thalfprecision.c \
thalfprecision_obj.c \
thash.c \
thead.c \
thexadecimal.c \
thonorcoeffprec.c \
thorner.c \
timplementpoly.c \
tinf.c \
tinit_with_custom_memory_functions.c \
tint_list_ops.c \
tintegral.c \
tinterpolate.c \
tinterval_list_ops.c \
tis_absolute.c \
tis_binary.c \
tis_decimal.c \
tis_default.c \
tis_double_double_obj.c \
tis_doubleextended_obj.c \
tis_double_obj.c \
tis_dyadic.c \
tis_false.c \
tis_file.c \
tis_fixed.c \
tis_floating.c \
tis_halfprecision_obj.c \
tis_hexadecimal.c \
tis_honorcoeffprec.c \
tis_off.c \
tis_on.c \
tis_perturb.c \
tis_pi.c \
tis_postscript.c \
tis_postscriptfile.c \
tis_powers.c \
tis_quad_obj.c \
tis_relative.c \
tis_round_down.c \
tis_round_to_nearest.c \
tis_round_towards_zero.c \
tis_round_up.c \
tis_single_obj.c \
tis_triple_double_obj.c \
tis_true.c \
tis_void.c \
tlength.c \
tlibraryconstant.c \
tlibraryconstant_with_data.c \
tlibraryfunction.c \
tlibraryfunction_with_data.c \
tlist.c \
tlog10.c \
tlog1p.c \
tlog2.c \
tlog.c \
tmacros_build_function.c \
tmantissa_and_exponent.c \
tmax.c \
tmid.c \
tmin.c \
tmsg_callback_functions.c \
tmul.c \
tname_free_variable.c \
tnearestint.c \
tneg.c \
tlogical_negate.c \
tnumberroots.c \
tnumerator.c \
tobj_is_end_elliptic_list.c \
tobj_is_error.c \
tobj_is_function.c \
tobj_is_list.c \
tobj_is_externaldata.c \
tobj_is_externalprocedure.c \
tobj_is_procedure.c \
tobj_is_range.c \
tobj_is_string.c \
tobj_is_structure.c \
tobject_list_ops.c \
toff.c \
ton.c \
tlogical_or.c \
tperturb.c \
tpi.c \
tpostscript.c \
tpostscriptfile.c \
tpow.c \
tpowers.c \
tprecision.c \
tprepend.c \
tprintdouble.c \
tprintexpansion.c \
tprintf.c \
tprintsingle.c \
tprocedurefunction.c \
tquad.c \
tquad_obj.c \
trange_from_bounds.c \
trange_from_interval.c \
trationalapprox.c \
trelative.c \
tremez.c \
trevert.c \
tround_down.c \
tround_to_nearest.c \
tround_towards_zero.c \
tround_up.c \
troundcoefficients.c \
tsearchgal.c \
tset_autosimplify_and_print.c \
tset_autosimplify.c \
tset_canonical_and_print.c \
tset_canonical.c \
tset_diam_and_print.c \
tset_diam.c \
tset_dieonerrormode_and_print.c \
tset_dieonerrormode.c \
tset_display_and_print.c \
tset_display.c \
tset_hopitalrecursions_and_print.c \
tset_hopitalrecursions.c \
tset_midpointmode_and_print.c \
tset_midpointmode.c \
tset_points_and_print.c \
tset_points.c \
tset_prec_and_print.c \
tset_prec.c \
tset_rationalmode_and_print.c \
tset_rationalmode.c \
tset_roundingwarnings_and_print.c \
tset_roundingwarnings.c \
tset_showmessagenumbers_and_print.c \
tset_showmessagenumbers.c \
tset_taylorrecursions_and_print.c \
tset_taylorrecursions.c \
tset_timing_and_print.c \
tset_timing.c \
tset_verbosity_and_print.c \
tset_verbosity.c \
tsimplify.c \
tsin.c \
tsingle.c \
tsingle_obj.c \
tsinh.c \
tsort.c \
tsqrt.c \
tstring.c \
tstring_list_ops.c \
tsub.c \
tsup.c \
tsubpoly.c \
tsubstitute.c \
ttail.c \
ttan.c \
ttanh.c \
ttriple_double.c \
ttriple_double_obj.c \
ttrue.c \
tv_annotatefunction.c \
tv_build_end_elliptic_list.c \
tv_build_list.c \
tv_construct_function.c \
tv_decompose_function.c \
tv_execute_procedure.c \
tv_fpminimax.c \
tv_get_subfunctions.c \
tv_implementpoly.c \
tv_interpolate.c \
tv_max.c \
tv_min.c \
tv_remez.c \
tvoid.c

EXTRA_DIST = check.proto $(TESTFILES) $(TESTFILES:.c=.reference)

check_PROGRAMS = force_compilation $(TESTFILES:.c=)
check_LIBRARIES = libraryexample.a # libraryexample.a will be a shared library actually,
                                   # but we do not know how to explain it to automake.

TESTS= $(TESTFILES:.c=.sh)

LDADD = $(top_builddir)/libsollya.la -lstdc++

MOSTLYCLEANFILES = $(TESTS) libraryexample.a

.PHONY: force_compilation$(EXEEXT)

force_compilation_SOURCES=

force_compilation$(EXEEXT):
	@echo "Recompiling sollya";cd $(top_builddir); $(MAKE) libsollya.la

libraryexample.$(OBJEXT): libraryexample.c
	$(CC) $(CFLAGS) $(CPPFLAGS) $(AM_CPPFLAGS) -fPIC -Wall -c '$(srcdir)/libraryexample.c'

libraryexample.a: libraryexample.$(OBJEXT) | force_compilation$(EXEEXT)
	$(CC) $(LDFLAGS) $(AM_LDFLAGS) -L$(top_builddir)/.libs/ -shared -o libraryexample.a libraryexample.$(OBJEXT) -lsollya -lmpfi -lmpfr -lgmp

$(TESTS): check.proto
	@echo "Building "$@
	@echo "#!/bin/sh" > $@
	@echo "TESTFILES=\""$(@:.sh=)"\"" >> $@
	@cat "$(srcdir)/check.proto" >> $@
	@chmod +x $@
